<template>
  <div>
    <div class="fixHead">
      <div class="title">
        <span class="iconfont icon-jiantou" @click="$router.go(-1)"></span>
        <span class="icon-home" @click="$router.push('/')"></span>
        <h1>草稿箱</h1>
      </div>
      <div style="height: 0.88rem;"></div>
    </div>
    <div class="art">
      <div class="title">共{{ list.length }}篇</div>
      <div class="list" v-if="list.length > 0">
        <van-swipe-cell v-for="(item, index) in list" :key="index">
          <div class="item" @click="toEdit(item)">
            <div class="cont">
              <div class="line1">{{ item.name }}</div>
              <div class="line2">
                <div class="left">{{ item.transform1 }}</div>
                <div class="right">{{ item.transform2 }}</div>
              </div>
            </div>
            <img class="img" src="../../assets/images/adver.jpg" />
          </div>
          <template #right>
            <button type="button" class="del">删除</button>
          </template>
        </van-swipe-cell>
      </div>
    </div>
  </div>
</template>

<script>
import { SwipeCell } from "vant";
export default {
  name: "",
  components: {
    vanSwipeCell: SwipeCell
  },
  props: {},
  data: function() {
    return {
      list: [
        {
          id: 100,
          name:
            "标题标题标题标题标题标题标题标题标题标题标题题标题标题题标题标题题标题标题题标题标题",
          transform1: "所有人可转",
          transform2: "￥2.99转换"
        },
        {
          id: 101,
          name: "标题标题标题标题标题标题标题标题",
          transform1: "社群成员可转",
          transform2: "免费转换"
        }
      ]
    };
  },
  mounted: function() {},
  methods: {
    toEdit(item) {
      this.$router.push({
        path: "/user/publish",
        query: {
          id: item.id
        }
      });
    }
  }
};
</script>

<style scoped>
.art .list .item .cont .line2 .left {
  font-size: 0.24rem;
  color: #999999;
}
.art .list .item .cont .line2 .right {
  font-size: 0.24rem;
  color: #deaa8a;
}
</style>
